class MembersService {
  async getMembers(params = {}) {
    const { page = 1, pageSize = 10, level, phone } = params;
    
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: {
            list: [],
            total: 0,
            page,
            pageSize
          },
          message: 'success'
        });
      }, 500);
    });
  }

  async getMemberById(id) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: null,
          message: 'success'
        });
      }, 300);
    });
  }

  async updateMember(id, data) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: { ...data, id },
          message: '会员信息更新成功'
        });
      }, 500);
    });
  }

  async recharge(id, amount) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: { id, amount },
          message: '充值成功'
        });
      }, 500);
    });
  }
}

export default new MembersService();
